﻿using HR60_PanelSoft.Model;
using HR60_PanelSoft.Model.BaseModel;
using HR60_PanelSoft.NetWork.Base;
using HR60_PanelSoft.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HR60_PanelSoft.NetWork.Sender
{
    class Sender_010E:BaseSender
    {

        public Sender_010E(byte panelNo, Panel panel,LoadPin pin)
        {

            Device device = (pin.getConnectedDevice());
            if (device == null)
                return;

            object[] ret = pin.getPanelAndNet();
          
            Net n = (Net)ret[1];

            byte[] data = new byte[6];

            data[0] = (byte)(device.type.switchTypes[0]);
            data[1] = 0x00;
            data[2] = 0;//人体感应响应标识
            data[3] = (byte)(getGolobDeviceNo(n,device) + 1);
            data[4] = (byte)(pin.time / 256);
            data[5] = (byte)(pin.time % 256);

            this.package = Package.getPackage(0x01, 0x0E, panelNo, (byte)(pin.index+1), data);

        }
    }
}
